<template>
    <Root @onEvent="onEvent" ModelString="cols:000001" ref="RootView" />
</template>
<script  setup>
import Root from './index.vue'
import { ref, provide } from 'vue'

import Config000001 from './Config/000001'
import Config000002 from './Config/000002'
import Dict from './Config/Dict'

const ModelMapping = {
    '000001': Config000001,
    '000002': Config000002
}
const GetDict = async function (key) {
    return Dict[key]
}

const GetModel = async function (key) {
    return ModelMapping[key]
}

provide('GetDict', GetDict);
provide('GetModel', GetModel);

const RootView = ref();

const onEvent = (val) => {
    console.log(val, RootView.value.GetValue());
}

</script>
<style lang="less" scoped></style>